home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 25 / AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso / PublicDomain / Spiele / MUI_FreeCell / Cards / Standard / ScaleCards.adpro < prev   
Text File  |  1998-02-07  |  1KB  |  74 lines

  1. /*
  2. ** ScaleToFillArea.adpro
  3. **
  4. ** $VER: ScaleToFillArea.adpro 1.0.0 (22.11.93)
  5. **
  6. ** This ARexx program allows the user to scale an image to fill
  7. ** a specific area, but preserving the image aspect of the original.
  8. **
  9. ** This script requires ADPro v2.5.0 (or higher).
  10. **
  11. ** Copyright © 1993 ASDG, Incorporated
  12. ** All Rights Reserved
  13. */
  14.  
  15.  
  16. ADDRESS "ADPro"
  17. OPTIONS RESULTS
  18.  
  19. NL = '0A'X
  20. SQ = '27'X
  21. DQ = '22'X
  22. TRUE  = 1
  23. FALSE = 0
  24. TempDefaults = "T:TempADProDefaults"
  25.  
  26.  
  27. /*
  28. ** Save the current environment.
  29. */
  30.  
  31. SAVE_DEFAULTS TempDefaults
  32.  
  33.  
  34. /*
  35. ** See what type of data is loaded in ADPro/MorphPlus.
  36.  
  37. CALL "FREDSCRIPTS:FREDFunctions/CheckForRawImageData" TRUE
  38. IF (RESULT ~= 0) THEN
  39.     CALL ErrorOut 10
  40. */
  41.  
  42. CALL "FREDSCRIPTS:FREDFunctions/GetADir" '"Cards directory"' '""""' TRUE
  43. IF (RESULT = '""""' DQ) THEN DO
  44.         ADPRO_TO_FRONT
  45.         CALL ErrorOut 10
  46. END
  47. SrcDir = RESULT
  48. SrcTemplate = SrcDir || "/CARD"
  49.  
  50. do i = 3 to 54
  51.   LOADER "UNIVERSAL" DQ || SrcTemplate || right(i,2,'0') || ".big" || DQ
  52.   PCT_SCALE 69 69
  53.   EXECUTE
  54.   SAVER "IFF" DQ || SrcTemplate || right(i,2,'0') || DQ "IMAGE"
  55. end
  56.  
  57. CALL ErrorOut 0
  58.  
  59.  
  60. ErrorOut:
  61.     PARSE ARG ExitCode
  62.  
  63.     IF (EXISTS( TempDefaults )) THEN DO
  64.         LOAD_DEFAULTS TempDefaults
  65.         IF (RC ~= 0) THEN DO
  66.             ADPRO_TO_FRONT
  67.             OKAY1 "Error restoring settings."
  68.         END
  69.  
  70.         ADDRESS COMMAND "Delete >NIL:" TempDefaults
  71.     END
  72.  
  73.     EXIT ExitCode
  74.